package com.gzhryc.shared_device.pcl.code.dao.enums;

public class PCLOrderEnum {

    public static enum State {

        WaitStart(1,"等待开始")
        ,CreatePwd(2, "生成密码中")
        ,Working(3, "使用中")
        ,Finish(5, "已完成")
        ,Close(6, "已关闭");

        private Integer index;
        private String note;

        State(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            State[] temp = State.values();
            for (int i = 0; i < temp.length; i++) {
                State item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum PayState {

        WaitPay(1, "等待支付"), Success(2, "支付成功"),Cancel(4, "撤销支付");

        private Integer index;
        private String note;

        PayState(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            PayState[] temp = PayState.values();
            for (int i = 0; i < temp.length; i++) {
                PayState item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }
}
